<?php
class Car{
    public $color;
    public $userName;
    public function __construct($color,$userName)
    {
        $this->color=$color;
        $this->userName=$userName;
    }
    public function use(){
        echo "我是机动车!";
    }
    public function equals($obj1,$obj2){
        if(($obj1->color==$obj2->color)&&($obj1->userName==$obj2->userName))
        return true;
        return false;
    }

    // //测试
    // $car1=new Car("红色","张三");
    // $car2=new Car("黄色","李四");
    // $car1->use();
    // var_dump($car1->equals($car1,$car2));

    class Taxi extends Car{
        public $company;
        public function __construct($company,$color,$userName)
    }
    // public function setuserName($userName){
    //     $this->userName=$userName;
    // }
    // public function getuserName(){
    //     echo $this-> color;
    // }
}
?>